import request from "@/utils/request";

/**
 * 获取评价总表的标题
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function getTitles(){
    return request.get('/evaluation/titles')
}

/**
 * 删除评价总表的标题
 * @param titleIds
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function deleteTitles(titleIds){
    return request.delete(`/evaluation/delete_titles?titleIds=${titleIds}`)
}

/**
 * 获取老师所教的班级 (领导获取全部班级)
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function getClasses(){
    return request.get('/evaluation/classes')
}


/**
 * 获取学生评价信息
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function getStudentInfo(evaluationId){
    return request.get(`/evaluation/all?evaluationId=${evaluationId}`)
}

/**
 * 修改学生评价信息
 * @param id
 * @param description
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function modifyInfo(id,description){
    return request.put(`/evaluation/update?id=${id}&description=${description}`)
}

/**
 * 删除学生评价记录
 * @param id
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function deleteInfo(id){
    const url = `/evaluation/delete?id=${id}`;
    return request.delete(url)
}
